<template>
<onekit-page>
<onekit-view onekit-class="container">
	<div is="onekit-template-head" :DATA="`${JSON.stringify({title:'button'})}`"></div>
	<onekit-view onekit-class="page-body">
		<onekit-view onekit-class="btn-area" id="buttonContainer">
			<onekit-button type="primary">页面主操作 Normal</onekit-button>
			<onekit-button type="primary" loading="true">页面主操作 Loading</onekit-button>
			<onekit-button type="primary" disabled="true">页面主操作 Disabled</onekit-button>
			<onekit-button type="default">页面次要操作 Normal</onekit-button>
			<onekit-button type="default" disabled="true">页面次要操作 Disabled</onekit-button>
			<onekit-button type="warn">警告类操作 Normal</onekit-button>
			<onekit-button type="warn" disabled="true">警告类操作 Disabled</onekit-button>
			<onekit-view onekit-class="button-sp-area">
				<onekit-button type="primary" plain="true">按钮</onekit-button>
				<onekit-button type="primary" disabled="true" plain="true">不可点击的按钮</onekit-button>
				<onekit-button type="default" plain="true">按钮</onekit-button>
				<onekit-button type="default" disabled="true" plain="true">按钮</onekit-button>
				<onekit-button onekit-class="mini-btn" type="primary" size="mini">按钮</onekit-button>
				<onekit-button onekit-class="mini-btn" type="default" size="mini">按钮</onekit-button>
				<onekit-button onekit-class="mini-btn" type="warn" size="mini">按钮</onekit-button>
			</onekit-view>
			<onekit-button type="primary" open-type="contact" :show-message-card="true" send-message-title="临时会话" @Contact="handleContact">打开客服会话</onekit-button>
			<onekit-button type="primary" open-type="share">触发用户转发</onekit-button>
			<onekit-button type="primary" open-type="getPhoneNumber" @Getphonenumber="handleGetPhoneNumber">获取用户手机号</onekit-button>
			<onekit-button type="primary" open-type="getUserInfo" lang="zh_CN" @Getuserinfo="handleGetUserInfo">获取用户信息</onekit-button>
			<onekit-button type="primary" open-type="openSetting" @Opensetting="handleOpenSetting">打开设置授权页</onekit-button>
			<onekit-button type="primary" open-type="feedback">打开意见反馈</onekit-button>
		</onekit-view>
	</onekit-view>
	<div is="onekit-template-foot"></div>
</onekit-view>
</onekit-page></template>
<script>
/* eslint-disable */
import Vue from 'vue';
import onekit_template_0 from '../../../../page/common/head.head.vue';Vue.component('onekit-template-head',onekit_template_0);
import onekit_template_1 from '../../../../page/common/foot.foot.vue';Vue.component('onekit-template-foot',onekit_template_1);
const ONEKIT_JSON= {
  "navigationBarTitleText": "button",
  "usingComponents": {
    
  }
};
const ONEKIT_SJS = {
};
import wx from '../../../../../weixin2vue/wx.js';
import Macro from '../../../../../weixin2vue/Macro.js';
const {getApp,getCurrentPages} = Macro;
import Page from '../../../../../weixin2vue/OnekitPage.js';
import Component from '../../../../../weixin2vue/OnekitComponent.js';
const types = [
  'default',
  'primary',
  'warn'
];
const pageObject = {
    "data":{
        "defaultSize":'default',
        "primarySize":'default',
        "warnSize":'default',
        "disabled":false,
        "plain":false,
        "loading":false
},
    "onShareAppMessage"(){
      return {
        "title":'button',
        "path":'page/component/pages/button/button'
};
    },
    "setDisabled"(){
      this.setData({
        "disabled":!this.data.disabled
});
    },
    "setPlain"(){
      this.setData({
        "plain":!this.data.plain
});
    },
    "setLoading"(){
      this.setData({
        "loading":!this.data.loading
});
    },
    "handleContact"(e){
      console.log(e.detail);
    },
    "handleGetPhoneNumber"(e){
      console.log(e.detail);
    },
    "handleGetUserInfo"(e){
      console.log(e.detail);
    },
    "handleOpenSetting"(e){
      console.log(e.detail.authSetting);
    },
    "handleGetUserInfo"(e){
      console.log(e.detail.userInfo);
    }
};
for(let i = 0;i < types.length;++i){
  (function(type){
    pageObject[type] = function(){
    const key = type + 'Size';
    const changedData = {
};
    changedData[key] = (this.data[key] == 'default')?'mini':'default';
    this.setData(changedData);
  };
  }(types[i]));
};
export default Page(ONEKIT_JSON,["true"],ONEKIT_SJS,pageObject);

</script>
<style 
 lang="css">
.onekit-button {
  margin-top: 15px ;
  margin-bottom: 15px ;
}
.button-sp-area {
  margin: 0 auto ;
  width: 60% ;
}
.mini-btn {
  margin-right: 5px ;
}
</style>